$MVC.Controller('tester',{
	submit: function(params){
		ApplicationError.config({prompt_user: false});
		this.subject = document.getElementById('subject').value;
		this.content = document.getElementById('content').value;
		params.event.kill();
		if(!this.subject || !this.content){
			alert('Enter a subject and content before saving your message, DamnIT.')
			return false;
		}
		$E('save').value = 'sending ...';
		new ApplicationError({
			subject: this.subject, 
			content: this.content
		}).save(this.continue_to('refresh'));
		
		
	},
	refresh: function(error){
		$E.insert('errors', '<tr><td><a href="/errors/'+error.id+'">'+this.subject+'</a></td><td>'+this.content+'</td></tr>');
		$E('save').value = 'save()';
		document.getElementById('subject').value = '';
		document.getElementById('content').value = '';
	}
})